package observerPattern;

public class Main {
    public static void main(String[] args) {
        NewAgency agency = new NewAgency(); //新闻机构--具体主题
        agency.registerObserver(new NewChannel("新闻频道1"));//新闻频道--具体观察者
        agency.registerObserver(new NewChannel("新闻频道2"));

        agency.setNews("新闻1"); //新闻发布


    }
}
